British lawmakers have agreed on plans to make assisted deaths legal in parts of the country, in a historic vote on a highly polarizing proposal.